package br.com.rapidrest.ioc;

import java.util.Locale;
import java.util.ResourceBundle;
import java.util.ResourceBundle.Control;

import br.com.rapidrest.util.CharsetControl;

public class CharsetMessagesFieldHandler extends MessagesFieldHandler {

	private String charset;

	public CharsetMessagesFieldHandler(String charset) {
		super();
		this.charset = charset;
	}

	@Override
	protected ResourceBundle getResourceBundle(String baseName, Locale locale) {
		Control control = new CharsetControl(charset);
		return ResourceBundle.getBundle(baseName, locale, control);
	}

}
